# 左下三角九九乘法表
row = 1
while row <= 9:
    for left_col in range(1,row+1):
        print('{0}*{1}={2:<4}'.format(left_col,row,row * left_col),end='')
    print()
    row += 1
print('='*80)
print()

# 左上三角九九乘法表
row = 9
while row >= 1:
    for left_col in range(1, row + 1):
        print('{0}*{1}={2:<4}'.format(left_col,row,row * left_col),end='')
    print()
    row -= 1
print('=' * 80)
print()

# 右下三角九九乘法表
row = 1
while row <= 9:
    print(' ' * (8 * (9 - row)),end='')
    for right_col in range(row,0,-1):
        print('{0}*{1}={2:<4}'.format(right_col,row,row * right_col),end='')
    print()
    row += 1
print('=' * 80)
print()

# 右上三角九九乘法表
row = 9
while row >= 1:
    print(' ' * (8 * (9 - row)),end='')
    for right_col in range(row,0,-1):
        print('{0}*{1}={2:<4}'.format(right_col,row,row * right_col),end='')
    print()
    row -= 1
print('=' * 80)